import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import styleImport, { VantResolve } from "vite-plugin-style-import";
// https://vitejs.dev/config/
export default ({ mode }) =>
	defineConfig({
		// base: mode === 'production' ? '/vue3-vite-vant-h5-template/' : '/',
		base: mode === "production" ? "./" : "/",
		plugins: [
			vue(),
			styleImport({
				resolves: [VantResolve()]
			})
		],
		server: {
			// 是否开启 https
			https: false,
			// 端口号
			port: 3002,
			host: "0.0.0.0",
			// 本地跨域代理
			proxy: {
				"/api/v1": {
					target: "http://192.168.1.25:8081",
					changeOrigin: true
				}
			}
		}
	});
